package top.lv666.graduation_design_serve.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import top.lv666.graduation_design_serve.pojo.Attention;
import top.lv666.graduation_design_serve.pojo.Blog;
import top.lv666.graduation_design_serve.pojo.BlogLike;
import top.lv666.graduation_design_serve.pojo.BlogRef;

import java.util.List;
import java.util.Map;


@Mapper
@Repository
public interface BlogMapper {
    void CreateBlog(Map<String, Object> map);

    void UpdateBlog(Map<String, Object> map);

    Blog SelectBlog(String blogID);

    /**
     * @apiNote 查询最火的博客
     */
    List<Blog> SelectBlogHot(Map<String, Object> map);

    /**
     * @apiNote 查询最新的博客
     */
    List<Blog> SelectBlogNow(Map<String, Object> map);

    /**
     * @apiNote 查询该用户是否点赞
     */
    List<BlogLike> SelectUserIsLike(Map<String, Object> map);

    /**
     * @apiNote 取消点赞
     */
    void deleteBlogLike(Map<String, Object> map);

    /**
     * @apiNote 点赞
     */
    void createBlogLike(Map<String, Object> map);

    /**
     * @apiNote 转发
     */
    void createRefBlog(Map<String, Object> map);

    /**
     * @apiNote 查询转发
     */
    List<BlogRef> SelectBlogRef(Map<String, Object> map);

    /**
     * @apiNote 删除转发
     */
    void DeleteBlogRef(Map<String, Object> map);

    /**
     * @apiNote 删除转发
     */
    void DeleteBlog(Map<String, Object> map);

    /**
     * @apiNote 查询最火的博客
     */
    List<Blog> SelectBlogByUser(Map<String, Object> map);

    /**
     * @apiNote 查询关注用户
     */
    List<Attention> SelectAttention(Map<String, Object> map);

    /**
     * 删除博客
     */
    void DeleteBlogById(Map<String, Object> map);

    /**
     * 我点赞的博客
     */
    List<BlogLike> SelectMyLikeBlog(Map<String, Object> map);

    /**
     * 我关注的用户发的博客
     */
    List<Blog> SelectMyFocusBlog(Map<String, Object> map);
}

